<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/include/header.jsp"%>
<title><s:text name="income.titleT"></s:text></title>

<script type="text/javascript"
	src="<%=request.getContextPath() %>/fare/js/show.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath() %>/fare/js/datePicker/WdatePicker.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath() %>/FusionCharts/FusionCharts.js"></script>
<link href="<%=request.getContextPath()%>/fare/css/base.css"
	rel="stylesheet" type="text/css" />

<link
	href='<%=request.getContextPath()%>/fare/js/cityquery/cityquery.css'
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="<%=request.getContextPath()%>/jsFile/common.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/jsFile/multiblepicker.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/fare/js/menu.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/fare/channelTariffs/ctjs/JQ.js"></script>

<script type="text/javascript"
	src="${pageContext.request.contextPath}/fare/js/checkIE.js"></script>
<!--检测IE-->
<script type="text/javascript"
	src="${pageContext.request.contextPath}/fare/js/button.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/fare/js/lrtk2.2.js">
</script>

<link
	href='<%=request.getContextPath()%>/fare/lib/huadong/css/huadong.css'
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="<%=request.getContextPath()%>/fare/lib/huadong/js/huadong.js"></script>


<script>
var COUNT=0;
$(document).ready(function(){	
	///$('#fromCity').querycity({'data':citysFlight,'tabs':labelFromcity,'hotList':hotList});
	////$('#toCity').querycity({'data':citysFlight,'tabs':labelFromcity,'hotList':hotList});
	var sope_Time = $("#sope_Time").val();	
	var nowdate = new Date();
	var nowMonthStr = nowdate.getMonth()+"";
	var nowDstr;
	if(nowMonthStr.length==1){
		nowDstr = nowdate.getFullYear()+"-0"+Number(nowdate.getMonth()+1)+"-"+nowdate.getDate();
	}else{
	    nowDstr = nowdate.getFullYear()+"-"+Number(nowdate.getMonth()+1)+"-"+nowdate.getDate();
	}	
	if(nowDstr==sope_Time){
		//$("#timetd1").css("background","#535353");
		//$("#timetd1").toggleClass("over1");

	}else{
		//$("#timetd4").css("background","#535353");
		//$("#timetd4").toggleClass("over1");
	}
	
});

function  DateAdd(interval,number,date)  
{  
 /* 
 *   功能:实现VBScript的DateAdd功能. 
 *   参数:interval,字符串表达式，表示要添加的时间间隔. 
 *   参数:number,数值表达式，表示要添加的时间间隔的个数. 
 *   参数:date,时间对象. 
 *   返回:新的时间对象. 
 *   var   now   =   new   Date(); 
 *   var   newDate   =   DateAdd( "d ",5,now); 
 *---------------   DateAdd(interval,number,date)   ----------------- 
 */  
        switch(interval)  
        {  
                 case   "y "   :   {  
                        date.setFullYear(date.getFullYear()+number);  
                        return   date;  
                         break;  
                 }  
                 case   "q "   :   {  
                         date.setMonth(date.getMonth()+number*3);  
                         return   date;  
                         break;  
                 }  
                case   "m "   :   {  
                        date.setMonth(date.getMonth()+number);  
                        return   date;  
                        break;  
                 }  
                 case   "w "   :   {  
                         date.setDate(date.getDate()+number*7);  
                         return   date;  
                         break;  
                }  
                 case   "d "   :   {  
                         date.setDate(date.getDate()+number*1);
                         return   date;  
                         break;  
                 }  
                 case   "h "   :   {  
                         date.setHours(date.getHours()+number);  
                         return   date;  
                         break;  
                }  
                 case   "mi "   :   {  
                         date.setMinutes(date.getMinutes()+number);  
                         return   date;  
                         break;  
                 }  
                 case   "s "   :   {  
                         date.setSeconds(date.getSeconds()+number);  
                         return   date;  
                         break;  
                }  
                 default   :   {  
                         date.setDate(d.getDate()+number);  
                         return   date;  
                         break;  
                 }  
        }  
}

//产生一个简单的遮罩层拉
function showWait(e,f){
	
	if($(e)[0]==undefined){return;}
	if($(e)[0].SHOWING==true){return;}
	
	if(true){//为了照顾IE迫不得已改代码
		var obj=document.createElement("DIV");
		var img=document.createElement("DIV");
		$(obj).css({
			"display":'none',
			'position':'absolute',
			'opacity':'0.3',
			'background-color':'#ECECEC',
			'width':$(e).width()+'px',
			'height':$(e).height()+'px',
		});
		$(img).css({
			'display':'none',
			'position':'absolute',
			'width':$(e).width()+'px',
			'height':$(e).height()+'px',
			'background-image':"url('<%=request.getContextPath()%>/images/blue-loading.gif')",
			'background-repeat':'no-repeat',
	    	'background-position':'center center',
	    	'z-index':'10000'
		});
		if(f==true){
			$(obj).css({"opacity":"0"});	
			$(img).css({"opacity":"0"});
		}
		obj.img=img;
		$(e)[0].obj=obj;
	}
	$(e).prepend($(e)[0].obj.img);
	$(e).prepend($(e)[0].obj);
	$($(e)[0].obj).css("display",'block');
	$($(e)[0].obj.img).css("display",'block');
	$(e)[0].SHOWING=true;
}

function hideWait(e){
	if($(e)[0]==undefined){return;}
	if($(e)[0].SHOWING!=true){return;}
	$($(e)[0].obj).css("display",'none');
	$($(e)[0].obj.img).css("display",'none');
	$(e)[0].SHOWING=false;
	
}

  function sWeekDate(){	 
	  var sope_Time = $("#sope_Time").val();
	 /// alert(sope_Time);
	  //$("#sope_Time").val(sope_Time);
	  loadAndDisplay($('#maingrid'),'indexAction!getChioceDateByshow.action');
	  showBydate2(sope_Time);
  }
  function showBydate2(date){
      $("#hdate").val(date);  
      $("#sope_Time").val(date);  
      $("#barChartText").text(date+"  "+$("#depCity_arrCity").val());
      loadAndDisplayBarData($('#maingrid'),'indexAction!analyseBarChart.action?action=two');
      
}
  function showBydate(obj){
        var date =  obj.substring(0,5);
        /***/
        
        var now = new Date();//30天第一天
 	    //去掉时分秒只比较到天
 	    var nowDateStr = now.getFullYear()+"-"+now.getMonth()+"-"+now.getDate();
 	    nowDateStr = nowDateStr.split('-');
 	    var newDateTonow = new Date(nowDateStr[0],nowDateStr[1],nowDateStr[2]);
 	    var newDate = new Date();//最后一天
 	    var chioceDate="";
 	    var arys;
 	   chioceDate = now.getFullYear()+"-"+date.replace("/","-");
	    	arys = chioceDate.split('-');     
	    	newDate = new Date(arys[0], arys[1]-1, arys[2]);
		if(newDate.getTime() < newDateTonow.getTime()){
			alert("日期超出可选择范围,请选择"+now.getFullYear()+"-"+Number(now.getMonth()+1)+"-"+now.getDate()+"之后30天的日期(含当天)");
			return false;
		}
		var edate = DateAdd('d ',29,new Date());
		var endDateStr = edate.getFullYear()+"-"+edate.getMonth()+"-"+edate.getDate();
		endDateStr = endDateStr.split('-');
		var endDate = new Date(endDateStr[0],endDateStr[1],endDateStr[2]);
		if(newDate.getTime() > endDate.getTime()){
			alert("日期超出可选择范围,请选择"+now.getFullYear()+"-"+Number(now.getMonth()+1)+"-"+now.getDate()+"之后30天的日期(含当天)");
			return false;
		}
		  /***/
        
        $("#hdate").val(date);  
        $("#sope_Time").val(date);  
        $("#barChartText").text(date+"  "+ $('#depCity_arrCity').val());
        loadAndDisplayBarData($('#maingrid'),'indexAction!analyseBarChart.action?action=two');
        sWeekDate2();
  }
  function sWeekDate2(){	 
	  var sope_Time = $("#sope_Time").val();
	 /// alert(sope_Time);
	  //$("#sope_Time").val(sope_Time);
	  loadAndDisplay($('#maingrid'),'indexAction!getChioceDateByshow.action');
  }
function grapDate(){ 
    var now = new Date();       
    var year = now.getFullYear();
    var month = now.getMonth() + 1;
    var day = now.getDate()-1;
   
    var today = year + "-";       
    if(month < 10)
        today += "0";       
    today += month + "-";       
    if(day < 10)
        today += "0";           
    today += day;       
    return(today); 
}
function currentDate(){ 
    var now = new Date();       
    var year = now.getFullYear();
    var month = now.getMonth() + 1;
    var day = now.getDate();
   
    var today = year + "-";       
    if(month < 10)
        today += "0";       
    today += month + "-";       
    if(day < 10)
        today += "0";           
    today += day;       
    return(today); 
}

function loadAndDisplay(grid,url){	
	    var tmp =$('#sope_Time').val();	  
	   //// alert(tmp);
		$.ajax({
	        url : url,
	        data:{
	        	sope_Time:tmp        
	        	},
	        cache : false, 
	        async : true,
	        type : "POST",
	       /// dataType:'json',
	       	complete: function(jqXHR, textStatus){
	       		var result = parseObj(jqXHR.responseText);	       	   
	       	    var strs = new Array();
	       	    strs = result.toString().split(",");	       	   
	       	    for(var i=0;i<strs.length;i++){
	       	    	
	 				$('#leafage'+Number(i+1)).html("<a href=\"javascript:void(0)\"  style=\"cursor:hand\" id=\"timetd"+(i+1)+"\" class=\"ssbt1\" onclick=\"showBydate(\'"+strs[i]+"\')\">"+strs[i]+"</a>");
	 				///$('#timetd'+Number(i+1) + " a").removeClass("over1");
	       	    }	
               /// $("#timetd1").css("background","");  
   	       	    ///$("#timetd4").css("background","#535353");
   	       	    ///$("#timetd1").toggleClass("over1");
   	       		///$("#timetd4").toggleClass("over1");
	       	 
	       	}
	    });
		$("#timetd4").attr("class","ssbt1 over1");
	}	 




 
function checkJspForm(obj,aid){	
	var ss =obj.split("-");
	$("#idToaClass").val(aid);
	$("#depCityCode").val(ss[0]);
	$("#arrCityCode").val(ss[1]);
	$("#isCity").val(ss[2]);
	$("#depCity_arrCity").val($("#"+aid).html());
	$("#mainrtltext").text('<s:i18n name="income"><s:text name="income.lowestPriceTrend"></s:text></s:i18n>'+$("#"+aid).html());	
	$("#grapDate").val(grapDate());
    $("#barChartText").text(currentDate()+"  "+$("#"+aid).html());
	///loadAndDisplayData($('#maingrid'),'lowestPriceCompareAction!analyseChart.action');
	loadAndDisplayData($('#maingrid'),'indexAction!analyseChart.action');
	COUNT++;
	if(COUNT==1){
		loadAndDisplayBarData($('#maingrid'),'indexAction!analyseBarChart.action');
	}else{
		showBydate(_generateDateStr());
	}
}
//"07/30-周二"
function _generateDateStr(){
	var d=new Date();
	var mm=d.getMonth()+1;
	mm=mm>=10?mm+"":"0"+mm;
	var dd=d.getDate();
	dd=dd>=10?dd+"":"0"+dd;
	return mm+"/"+dd+"-";
}


/* function selectCity(){
	var city = $.trim($("#city").val());
	var aid=$("#city").get(0).selectedIndex;
	$("#idToaClass").val('Submit'+(aid+1));//Submit3
	var ss =city.split("-");
	$("#depCityCode").val(ss[0]);
	$("#arrCityCode").val(ss[1]);
	$("#isCity").val(ss[2]);
	$("#mainrtltext").text("最低价走势: "+city);	
	$("#grapDate").val(grapDate());
    $("#barChartText").text(currentDate()+"  "+ $('#depCityCode').val()+"-"+$('#arrCityCode').val());
	///loadAndDisplayData($('#maingrid'),'lowestPriceCompareAction!analyseChart.action');
	loadAndDisplayData($('#maingrid'),'indexAction!analyseChart.action');
	loadAndDisplayBarData($('#maingrid'),'indexAction!analyseBarChart.action');
	reloadSlect();
} */


</script>
</head>
<body>
	<%@ include file="/include/home/home_header.jsp" %>
	<jsp:include page="/pages/system/feedback/feedback.jsp"></jsp:include>
	<div class="main_max">
		<div class="high_10"></div>
		<div class="nav_bg" style="display: none">
			<div class="nav">
				<ul style="list-style: none; margin: 0;">
					<!-- <li class="cur"><a href="#" class="click">全航线</a></li> <li class="cur" style="display: none"></li> -->
					<c:if test="${not empty citylist }">
						<c:forEach var="city" items="${citylist}" varStatus="stat">
							<li><a href="javascript:void(0)"
								style="cursor: hand; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline"
								onclick="javascript:checkJspForm('${city.departcitycode}-${city.arrivalcitycode}-${city.iscity}','Submit${stat.index+1}');"
								id="Submit${stat.index+1}">${city.departcity}-${city.arrivalcity }</a>
						</c:forEach>
					</c:if>
				</ul>
				<div class="curBg"></div>
				<div class="cls"></div>
			</div>
			<form id="ctform" name="ctform" method="post">
				<input type="hidden" id="hdate" name="hdate" /> <input
					type="hidden" name="depCity_arrCity" id="depCity_arrCity" /><input
					type="hidden" name="depCityCode" id="depCityCode" /> <input type="hidden"
					name="arrCityCode" id="arrCityCode" /><input type="hidden"
					name="isCity" id="isCity" /> <input type="hidden"
					name="beginDateAfterToday" id="beginDateAfterToday" value="1" /> <input
					type="hidden" name="endDateAfterToday" id="endDateAfterToday"
					value="30" /> <input type="hidden" name="channels" id="channels"
					value="" /> <input type="hidden" name="priceType" id="priceType"
					value="1" /> <input type="hidden" name="grapDate" id="grapDate" />
				<input type="hidden" name="bookingType" id="bookingType" value="预定" />
				<input type="hidden" name="depTimeHour1" id="bookingType" value="00" />
				<input type="hidden" name="depTimeMin1" id="bookingType" value="00" />
				<input type="hidden" name="depTimeHour2" id="bookingType" value="23" />
				<input type="hidden" name="depTimeMin2" id="bookingType" value="59" />
				<input type="hidden" id="idToaClass" name="idToaClass"
					value="${idToaClass}" />

				<div class="nav_add" style="margin-top: 8px;">
					<select name="city" id="city" class="selectww"
						onchange="selectCity()">
						<c:if test="${not empty citylist }">
							<c:forEach var="city" items="${citylist}" varStatus="stat">
								<option value="${city.departcity}-${city.arrivalcity }">${city.departcity}-${city.arrivalcity }</option>
							</c:forEach>
						</c:if>
					</select>
				</div>

			</form>
		</div>
		<script type="text/javascript">
	$(function(){
		
		manager=huadong("huadong_menu_div");
	});
</script>
		<!--  ***********************************滑动菜单**********************************************************  -->
		<div id="huadong_menu_div" class="HUADONG">
			<ul>
				<c:if test="${not empty citylist }">
					<c:forEach var="city" items="${citylist}" varStatus="stat">
						<li><a href="javascript:void(0)" id="Submit${stat.index+1}"
							onclick="javascript:checkJspForm('${city.departcitycode}-${city.arrivalcitycode}-${city.iscity}','Submit${stat.index+1}');">${city.departcity}-${city.arrivalcity }
						</a></li>
					</c:forEach>
				</c:if>
			</ul>
		</div>
		<div class="high_10"></div>
		<div class="right_max">
			<!-- 
<div class="right_char">
<ul>
<li class="title">航线最低价</li>
</ul>
<ul>
<li>
	<div id="lowprice" style="width: 155px; height: 113px;text-align:center;" >3333</div>
</li>
</ul>
</div>
-->
			<div class="right_char" id="_right_char_1">
				<ul>
				<!-- 	<li class="title">航线最低价</li> -->
					<li class="title">
						<s:i18n name="income"> 
  								<s:text name="income.lineLowestPrice"></s:text>
						</s:i18n>
					<%-- <s:text name="helloss"></s:text> --%>
					</li>
					<li class="cont">
						<%-- <s:i18n name="income"> 
  								<s:text name="income.marketAndMe"></s:text>
						</s:i18n> --%><span id="mymaket"></span>
					</li>
				</ul>
				<ul>
					<li class="left" id="priceVo-myprice"></li>
					<li class="right" id="priceVo-marketprice"></li>
					<li class="leftc" id="priceVo-myflight"></li>
					<li class="rightc" id="priceVo-marketflight"></li>
					<li class="leftbc">
					<s:i18n name="income"> 
  							<s:text name="income.myLowestPrice"></s:text>
					</s:i18n></li>
					<li class="rightbc">
						<s:i18n name="income"> 
  							<s:text name="income.marketLowestPrice"></s:text>
					</s:i18n></li>
					</li>
				</ul>
			</div>
			<!--  -->
			<div class="high_10"></div>
			<div class="right_char" id="_right_char_2">
				<ul>
					<li class="title">
						<s:i18n name="income"> 
  							<s:text name="income.incomePerKilometer"></s:text>
					</s:i18n>
					</li>
					<li class="cont"><%-- <s:i18n name="income"> 
  							<s:text name="income.marketAndMe"></s:text>
					</s:i18n> --%> <span id="incomeVo-market"></span>
					</li>
				</ul>
				<ul>
					<li class="left" id="incomeVo-myPrice"></li>
					<li class="right" id="incomeVo-marketPrice"></li>
					<li class="leftc" id="incomeVo-myFlightNO"></li>
					<li class="rightc" id="incomeVo-marketFlightNo"></li>
					<li class="leftbc"><s:i18n name="income"> 
  							<s:text name="income.myLowestPrice"></s:text>
					</s:i18n></li>
					<li class="rightbc"><s:i18n name="income"> 
  							<s:text name="income.marketLowestPrice"></s:text>
					</s:i18n></li>
				</ul>
			</div>


			<div class="high_10"></div>
			<div class="right_char" id="_right_char_3">
				<ul>
					<li class="title"><s:i18n name="income"> 
  							<s:text name="income.passengerLoadFactor"></s:text>
					</s:i18n></li>
					<li class="cont"><%-- <s:i18n name="income"> 
  							<s:text name="income.marketAndMe"></s:text>
					</s:i18n> --%><span id="occupVo-market"></span></li>
				</ul>
				<ul>
					<li class="left" id="occupVo-myPrice"></li>
					<li class="right" id="occupVo-marketPrice"></li>
					<li class="leftc" id="occupVo-myFlightNO"></li>
					<li class="rightc" id="occupVo-marketFlightNo"></li>
					<li class="leftbc"><s:i18n name="income"> 
  							<s:text name="income.myLowestPrice"></s:text>
					</s:i18n></li>
					<li class="rightbc"><s:i18n name="income"> 
  							<s:text name="income.marketLowestPrice"></s:text>
					</s:i18n></li>
				</ul>
			</div>

		</div>
		<div class="left_max">
			<div class="char_bg2">
				<ul>
					<li class="title" id="mainrtltext"><s:i18n name="income"> 
  							<s:text name="income.lowestPriceTrend"></s:text>
					</s:i18n></li>
					<li class="char" style="padding-top: 7px">
						<!-- ************************************最低价走势报表************************************************报表位置标记 -->
						<div id="chartContainer" style="width: 100%; height: 420px;"></div>
						<!-- overflow-x:scroll; -->
						<div style="display: none">
							<input id="text" type="text" value="<s:property value="xml"/>">
						</div>

						<div style="display: none">
							<input id="text2" type="text">
						</div> <!-- <div style="display: none"> --> <input id="timestr"
						type="hidden"> <!-- </div> -->
					</li>

				</ul>
			</div>


		</div>
		<div class="width_800"></div>
		<%-- ********************************************* --%>

		<div class="left_max" id="">
			<div class="time_title2">
				<s:i18n name="income"> 
  <s:text name="income.flightTime"></s:text>
</s:i18n> <img style="cursor: pointer;"
					onclick="WdatePicker({onpicked:sWeekDate,el:'sope_Time',skin:'whyGreen',lang:'<s:text name='forms.locale'/>',doubleCalendar:false,dateFmt:'yyyy-MM-dd',minDate: '%y-%M-%d',maxDate:'${maxDate}'});"
					src="${pageContext.request.contextPath}/fare/channelTariffs/ctimages/calendar.png"
					border="0" /> <input type="hidden" id="sope_Time" name="sope_Time"
					value="${sope_Time}" />
			</div>
			<div class="time_max" id=''>
				<div class="sfbz_btbox">
					<s:iterator value="list_str" status="stat" id="ls">
						<span id="leafage${stat.index+1 }"><a
							href="javascript:void(0)" id="timetd${stat.index+1}" rel="${ls}"
							onclick="showBydate('<s:property escapeHtml="true" value="ls"/>')"
							class="ssbt1"> <s:property escapeHtml="false" value="ls" /></a> </span>
					</s:iterator>
				</div>
			</div>
		</div>
		<div class="width_800"></div>

		<div class="left_max">
			<div class="char_bg2">
				<ul>
					<li class="title" id="barChartText"></li>
					<li class="char" style="padding-top: 1px; height: 1px">
						<div class="focus" id="_focus_div">
							<ul class="rslides f426x240" id="show_ui_id">
								<li></li>
								<li></li>
							</ul>
							<a class="rslides_nav rslides1_nav prev">Previous</a> <a
								class="rslides_nav rslides1_nav next">Next</a>


						</div>
					</li>
				</ul>
			</div>

		</div>


		<%-- ***************************************************************** --%>
	</div>
	<div class="clear"></div>
	<%@ include file="/include/home/home_footer.jsp" %> 

	<script language="JavaScript">
	
	$(function(){
		///$('#${idToaClass}').addClass('cur');
		var idToaClass = $("#idToaClass").val();
		var lid = idToaClass.substring(6,idToaClass.length);
 	});
	
	var myflightNo="ZH9187";
	var marketflightNo="CA4304";
	
	function loadAndDisplayData(grid,url){
		if($('#depCityCode').val()!=''&&$('#arrCityCode').val()!=''){
			$.ajax({
		        url : url,
		        data:{
		        	depCityCode:$('#depCityCode').val(),
		        	arrCityCode:$('#arrCityCode').val(),
		        	isCity:$('#isCity').val(),
		        	beginDateAfterToday:$('#beginDateAfterToday').val(),
		        	endDateAfterToday:$('#endDateAfterToday').val(),
		        	channels:$('#channels').val(),   
		        	priceType:$('#priceType').val(),
		        	grapDate:$('#grapDate').val(),
		        	depTimeHour1:$('#depTimeHour1').val(),
		        	depTimeHour2:$('#depTimeHour2').val(),
		        	depTimeMin1:$('#depTimeMin1').val(),
		        	depTimeMin2:$('#depTimeMin2').val(),
		        	bookingType:$('#bookingType').val(),
		        	idToaClass:$('#idToaClass').val()
		        	},
		        cache : false, 
		        async : true,
		        type : "post",
		        beforeSend:function(){
		        	
		        	showWait($("#huadong_menu_div"),true);
		        	showWait($("#chartContainer"));
		        	showWait($("#_right_char_1"));
		        	showWait($("#_right_char_2"));
		        	showWait($("#_right_char_3"));
		        },
		       	complete: function(jqXHR, textStatus){
		       		
		       		if(jqXHR.status==200){
		       			result = parseObj(jqXHR.responseText);
		       			var data = result.json;
			        	var xml = result.xml;
			        	if(data!=null&&data!='null'){
			        		var  mylower="";//我比市场低还是高
			        		var marklower="";//比率结果
			        		if(data.hightOrLower=='null'||data.hightOrLower==null){mylower='';}else{mylower=data.hightOrLower;}
			        		if(data.result=='null'||data.result==null){marklower='';}else{
			        			marklower=data.result;
			        			if(marklower<0){
			        				marklower=-marklower;
			        			}
			        			}
			        		/* $("#mymaket").html(mylower+":"+marklower+"%");  */
			        		if(data.hightOrLower=="H"){
			        			mylower='<%=request.getContextPath()%>/images/ico16/arrow_down.gif';
			        		}else{
			        			mylower='<%=request.getContextPath()%>/images/ico16/arrow_up.gif';
			        		}
			        		if(marklower>0){
			        			$("#mymaket").html("<img src='"+mylower+"'/>"+marklower+"%");
			        		}else{
			        			$("#mymaket").html("");
			        		}
			        		$("#priceVo-myprice").html(data.myPrice);
			        		$("#priceVo-marketprice").html(data.marketPrice);
			        		$("#priceVo-myflight").html(data.myFlightNO);
			        		$("#priceVo-marketflight").html(data.marketFlightNo);
			        		myflightNo=data.myFlightNO;
			        		marketflightNo=data.marketFlightNo;
			        		
			        	}
			        	var idToaClass=result.classID;
				        	if(idToaClass!=null&&idToaClass!='null'){
				        		var lid=idToaClass.substr(6,idToaClass.length);
						        	for(i=1;i<8;i++){
							        		if(i==lid){
								        		$("#prli"+lid).attr('class','cur'); 
							        		continue;
							        		}else{
							        			$("#prli"+i).removeClass();
								        		///$("#Submit"+i).removeClass();
							        		}
						        	}
				        		
				        	}
			        	$('#text').val(xml);
			        	setChart();		        	
		       		}
		       		hideWait($("#chartContainer"));
		       		hideWait($("#_right_char_1"));
		        	hideWait($("#_right_char_2"));
		        	hideWait($("#_right_char_3"));
		        	hideWait($("#huadong_menu_div"));
		       	}
		    });
		}	 
	}

	function loadAndDisplayBarData(grid,url){	 
		if($('#depCityCode').val()!=''&&$('#arrCityCode').val()!=''){
			$.ajax({
		        url : url,
		        data:{
		        	hdate:$('#hdate').val(),
		        	depCityCode:$('#depCityCode').val(),
		        	arrCityCode:$('#arrCityCode').val(),
		        	beginDateAfterToday:$('#beginDateAfterToday').val(),
		        	endDateAfterToday:$('#endDateAfterToday').val(),
		        	channels:$('#channels').val(),   
		        	priceType:$('#priceType').val(),
		        	grapDate:$('#grapDate').val(),
		        	depTimeHour1:$('#depTimeHour1').val(),
		        	depTimeHour2:$('#depTimeHour2').val(),
		        	depTimeMin1:$('#depTimeMin1').val(),
		        	depTimeMin2:$('#depTimeMin2').val(),
		        	bookingType:$('#bookingType').val()
		        	},
		        cache : false, 
		        async : true,
		        type : "POST",
		        beforeSend:function(){
		        	showWait($("#_focus_menu"),true);
		        	showWait($("#_focus_div"));
		        },
		       	complete: function(jqXHR, textStatus){	 
		       		if(jqXHR.status==200){
		       			result = parseObj(jqXHR.responseText);
			        	var occupVo=result[0].occupVo;
			        	var incomeVo=result[0].incomeVo;
			        	if(occupVo){
			        		var  myoccupVo="";//我比市场低还是高
			        		if(occupVo.hightOrLower=='H'){
			        			myoccupVo='<%=request.getContextPath()%>/images/ico16/arrow_down.gif';
			        		}else{
			        			myoccupVo='<%=request.getContextPath()%>/images/ico16/arrow_up.gif';
			        		}
			        		var rate1=0.0;
			        		if(occupVo.result<0){
			        			rate1=-occupVo.result;
			        		}else{
			        			rate1=occupVo.result;
			        		}
			        		if(rate1>0){
			        			$("#occupVo-market").html("<img src='"+myoccupVo+"' style='vertical-align:middle'/>"+rate1+"%");
			        		}else{
			        			$("#occupVo-market").html("");
			        		}
				        	$("#occupVo-myPrice").html(occupVo.myPrice);
				        	$("#occupVo-marketPrice").html(occupVo.marketPrice);
				        	$("#occupVo-myFlightNO").html(occupVo.myFlightNO);
				        	$("#occupVo-marketFlightNo").html(occupVo.marketFlightNo);
			        	}else{
			        		$("#occupVo-market").html("");
				        	$("#occupVo-myPrice").html("");
				        	$("#occupVo-marketPrice").html("");
				        	$("#occupVo-myFlightNO").html("");
				        	$("#occupVo-marketFlightNo").html("");
			        	}
			        	if(incomeVo){
			        		var myIncomeVo="";
			        		if(incomeVo.hightOrLower=='H'){
			        			myIncomeVo='<%=request.getContextPath()%>/images/ico16/arrow_down.gif';
			        		}else{
			        			myIncomeVo='<%=request.getContextPath()%>/images/ico16/arrow_up.gif';
			        		}
			        		var rate2=0.0;
			        		if(incomeVo.result <0){
			        			rate2=-incomeVo.result;
			        		}else{
			        			rate2=incomeVo.result;
			        		}
			        		if(rate2>0){
			        			$("#incomeVo-market").html("<img src='"+myIncomeVo+"'/>"+rate2+"%");
			        		}else{
			        			$("#incomeVo-market").html("");
			        		}
				        	$("#incomeVo-myPrice").html(incomeVo.myPrice);
				        	$("#incomeVo-marketPrice").html(incomeVo.marketPrice);
				        	$("#incomeVo-myFlightNO").html(incomeVo.myFlightNO);
				        	$("#incomeVo-marketFlightNo").html(incomeVo.marketFlightNo);
			        	}else{
			        		$("#incomeVo-market").html("");
				        	$("#incomeVo-myPrice").html("");
				        	$("#incomeVo-marketPrice").html("");
				        	$("#incomeVo-myFlightNO").html("");
				        	$("#incomeVo-marketFlightNo").html("");
			        	}
						var ui=$("#show_ui_id");
						ui.empty();
			        	for(k=1;k<result.length;k++){
			        		if(k==1){//rslides1_on
			        			ui.append('<li id="rslides1_s'+(k-1)+'" class="rslides1_on" style="display: list-item; float: left; position: relative;"><div id="bar_chart'+k+'" style="width:100%;height:350px;"></div></li>');
			        		}else{
			        			ui.append('<li id="rslides1_s'+(k-1)+'" style="display: none; float: none; position: absolute;"><div id="bar_chart'+k+'" style="width:100%;height:350px;"></div></li>');
			        		}
			        	}
			        	for(k=1;k<result.length-1;k++){
			        		var xml = result[k].xml;
			        		showBar(xml,k);
			        	}
			        
						//if(isHeadDate=='0'){
			        			///为空显示图片
			        			//ui.html("");
			        			//ui.append("<li><div id='bar_chart' style='width:100%;height:350px;'><img src='<%=request.getContextPath()%>/fare/image/leafage.png' width='320px' height='200px' /></div></li>");
			        			//ui.append("<li><div id='bar_chart' style='width:100%;height:350px;'><img src='<%=request.getContextPath()%>/fare/image/leafage.png'  style='height:230px;margin-top:60px' /></div></li>");
			        		///	$("#bar_chart").hide();
			        		//}else{
			        			readyFunction();
			        		//}
						
			        	///showBar();		        	
		       		}
		       		hideWait($("#_focus_div"));
		       		hideWait($("#_focus_menu"));
		       		$("#timetd4").attr("class","ssbt1 over1");
		       	}
		    });
			
		}	 
	}
	
	
	$("#timetd4").attr("class","ssbt1 over1");
	
		function setChart() {
			//$("#chartContainer").show();
			var xml = document.getElementById('text').value;
			$("#leaf").val(xml);
			var width = '770';
			var chart2 = new FusionCharts('<%=request.getContextPath()%>/FusionCharts/MSLine.swf', "chart2Id", width, "400");
		chart2.setDataXML(xml);
		chart2.setTransparent(true);
		chart2.render("chartContainer");	
 	}
	function showBar(xml,id){
		///$("#bar_chart"+id).show();
	 	//var xml = document.getElementById('text2').value;
	 	var width = '770';	
	 	//if(xml!=''||xml!=null){
			var chart3 = new FusionCharts("<%=request.getContextPath()%>/FusionCharts/MSCombiDY2D.swf",
						"chart3Id"+id, width, "330");
				chart3.setDataXML(xml);
				chart3.setTransparent(true);
				chart3.render("bar_chart"+id);
				///$("#leaf2").val(xml);
		 ///	}
		}
		var k=0;
		if(k==0){
			document.getElementById("Submit1").click();
			k=1;
		}
	</script>
	<!-- 
	<input type="text" value="" id="leaf"></input><br></br>
	<input type="text" value="" id="leaf2"></input>
	 -->
</body>
</html>
<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/fare/channelTariffs/css/style.css" />
<STYLE TYPE="text/css" MEDIA=screen>
<!--
.sfbz_btbox a,.sfbz_btbox a span.hover {
	width: 90px;
	height: 82px;
	float: left;
	overflow: hidden;
	display: block;
	line-height: 23px;
	font-size: 14px;
	font-weight: bold;
	color: #fff;
	padding-top: 21px;
}

.curBg {
	background: #F00 url(../images/new/nav_click.png) no-repeat;
	height: 47px;
	position: absolute;
	top: -5px;
	width: 98px;
	left: 0px;
	z-index: -1;
}
-->
</STYLE>
<script type="text/javascript">
	readyFunction();
</script>
